# In [1]: import torch

# In [2]: import torch.nn as nn

# In [3]: layer=nn.Conv2d(1,3,kernel_size=3,stride=1,padding=0)

# In [4]: x=torch.rand(1,1,28,28)

# In [5]: out=layer.forward(x)

# In [6]: out.shape
# Out[6]: torch.Size([1, 3, 26, 26])

# In [7]: layer=nn.Conv2d(1,3,kernel_size=3,stride=1,padding=1)

# In [8]: out=layer.forward(x)

# In [9]: out.shape
# Out[9]: torch.Size([1, 3, 28, 28])

# In [10]: layer=nn.Conv2d(1,3,kernel_size=3,stride=2,padding=1)

# In [11]: out=layer.forward(x)

# In [12]: out.shape
# Out[12]: torch.Size([1, 3, 14, 14])

# In [13]: out=layer(x)

# In [15]: out.shape
# Out[15]: torch.Size([1, 3, 14, 14])